package com.ljy.tkmodel.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ljy.tkmodel.entity.LjyZhuanshuoAnswerUser0;
import com.ljy.tkmodel.client.UserFeignClient;
import com.ljy.tkmodel.mapper.LjyZhuanshuoAnswerUser0Mapper;
import com.ljy.tkmodel.service.LjyZhuanshuoAnswerUser0Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ljy.tkuser.entity.LjyBigUser;
import com.ljy.tkuser.service.LjyBigUserService;
import com.ljy.tkuser.util.UserCookieRedis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.ArrayList;

/**
 * <p>
 * 答题记录 服务实现类
 * </p>
 *
 * @author testjava
 * @since 2022-01-10
 */
@Service
public class LjyZhuanshuoAnswerUser0ServiceImpl extends ServiceImpl<LjyZhuanshuoAnswerUser0Mapper, LjyZhuanshuoAnswerUser0> implements LjyZhuanshuoAnswerUser0Service {
    @Autowired
    private  UserFeignClient userFeignClient;
    @Override
    public ArrayList<LjyZhuanshuoAnswerUser0> selectUserAnswerInfo( HttpServletRequest request) {
       // LjyBigUser  user =(LjyBigUser)session.getAttribute("loginUser");
        UserCookieRedis userCookieRedis = new UserCookieRedis();
        LjyBigUser user = userCookieRedis.getUserCookie();
        QueryWrapper<LjyZhuanshuoAnswerUser0> queryWrapper =new QueryWrapper<>();
        queryWrapper.eq("user_id",user.getUserId());
        ArrayList<LjyZhuanshuoAnswerUser0> answerUser0s = (ArrayList)baseMapper.selectList(queryWrapper);
        return answerUser0s;
    }
}
